//
//  NetTools.m
//  SeseNews
//
//  Created by lanou3g on 15/7/24.
//  Copyright (c) 2015年 Sese工作室. All rights reserved.
//

#import "NetTools.h"

@implementation NetTools
// shareInstance
+(instancetype)shareInstance{
    static NetTools * tools = nil;
    if (!tools) {
        tools = [[NetTools alloc]init];
    }
    return tools;
}

// get请求
+(void)GET:(NSString *)URLString
parameters:(id)parameters
   success:(void (^)(AFHTTPRequestOperation *operation, id responseObject))success
   failure:(void (^)(AFHTTPRequestOperation *operation, NSError *error))failure{
    // 获取 工具单例
    NetTools * tool = [NetTools shareInstance];
    // 调用 实例方法
    [tool GET:URLString parameters:parameters success:success failure:failure];
}
-(void)GET:(NSString *)URLString
parameters:(id)parameters
   success:(void (^)(AFHTTPRequestOperation *operation, id responseObject))success
   failure:(void (^)(AFHTTPRequestOperation *operation, NSError *error))failure{
    AFHTTPRequestOperationManager * manager = [AFHTTPRequestOperationManager manager];
    [manager GET:URLString parameters:parameters success:success failure:failure];

}
@end
